<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js" type="text/javascript"></script>
    <style>
        .active{
            color: red;
        }
    </style>
</head>
<body>
    <div id="app" >
        <!-- 对象{}, [] -->
        <h2 v-bind:class="{active: isActive, line: isLine}">{{message}}</h2>
        <button v-on:click="btnClick">click</button>
        <button @click="btnClick">click</button>
    </div>
</body>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            message: "font",
            isActive: true,
            isLine: true
        },
        methods: {
            btnClick: function(){
                this.isActive = !this.isActive;
            }
        }
    })
</script>
</html>